/**
 * 给定若干字符串，如果字符串中含有"bie"且该字符串之前没有出现过
 * 则将该字符串加入集合，并且输出。
 */
#include <bits/stdc++.h>
using namespace std;

int N;
set<string> Set;

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> N;
    string s; 
    decltype(Set.begin()) it;
    
    for(int m,i=1;i<=N;++i){
        cin >> m;
        bool flag = true;
        for(int j=0;j<m;++j){
            cin >> s;
            if(-1 != s.find("bie") and Set.end() == (it = Set.find(s))){
                it = Set.insert(it, s);
                cout << s << endl;
                flag = false;
            }
        }
        if(flag) cout << "Time to play Genshin Impact, Teacher Rice!" << endl;
    }
    return 0;
}